<template>
	<view class="scrollFull">
		<cu-custom :isBack="false" title="健康小屋">
			<image slot="left" src="/static/images/home.png" class="homeIcon"></image>
		</cu-custom>

		<searchFilter @select="selectHandle"></searchFilter>

		<view class="mapBox">
			<map
				class="mapclass"
				scale="17"
				:latitude="mapOption.latitude"
				:longitude="mapOption.longitude"
				:markers="mapOption.markers"
			></map>
		</view>

		<view class="static">
			<view class="static-line">
				现已接入
				<text class="a">20</text>
				个监测点，
				<text class="a">40</text>
				个摄像头
			</view>
		</view>
	</view>
</template>

<script>
import searchFilter from '@/components/searchFilter/searchFilter.vue';
export default {
	components: {
		searchFilter
	},
	data() {
		return {
			mapOption: {
				longitude: '122.106863',
				latitude: '30.016028',
				markers: []
			},

		};
	},
	onLoad() {
		const icon1 = {
				width: 36,
				height: 36,
				iconPath: '/static/images/house/house.png' //重点在路径这里
			},
			icon2 = {
				width: 41,
				height: 55,
				iconPath: '/static/images/house/star.png' //重点在路径这里
			};

		this.mapOption.markers = [
			{
				id: 0, //id 必填项
				longitude: this.mapOption.longitude - 0.001,
				latitude: this.mapOption.latitude - 0.001,
				...icon1
			},
			{
				id: 1, //id 必填项
				longitude: this.mapOption.longitude,
				latitude: this.mapOption.latitude,
				...icon2
			}
		];
	},
	methods: {
		selectHandle(e) {
			console.log(e);
		}
	}
};
</script>

<style lang="scss" scoped>
.scrollFull {
	display: flex;
	flex-direction: column;
	background-color: #f7f7f7;
	padding-top: 24rpx;
	box-sizing: border-box;
	/deep/ .mapFilter {
		position: relative;
		z-index: 9999999;
	}
	.homeIcon {
		width: 38rpx;
		height: 38rpx;
		margin-left: 20rpx;
	}
	.mapBox {
		position: fixed;
		top: 0;
		left: 0;
		bottom: 0;
		right: 0;
		.mapclass {
			width: 100%;
			height: 100%;
		}
	}

	.static {
		position: fixed;
		box-sizing: border-box;
		padding: 40rpx 48rpx;
		bottom: 0;
		left: 0;
		right: 0;
		width: 750rpx;
		height: 150rpx;
		background: #ffffff;
		box-shadow: 0px 4rpx 13rpx 0px rgba(34, 23, 20, 0.1);
		border-radius: 20rpx 20rpx 0px 0px;
		&-line {
			display: flex;
			align-items: center;

			font-size: 28rpx;
			font-family: PingFang SC;
			font-weight: 500;
			color: #333333;
			.a {
				display: inline-block;
				margin: 0 10rpx;
				color: #52affd;
			}
			&::before {
				margin-right: 18rpx;
				content: '';
				display: block;
				width: 4rpx;
				height: 32rpx;
				background: #60c6fd;
				border-radius: 2rpx;
			}
		}
	}
}
</style>
